<%@ include file="../confHeader.jsp" %>
<%@ include file="../mensagens.jsp" %>
<html>
<head>
	
</head>
<body>

 <html:javascript formName="FornecedorForm" />  
 <html:form  action="fornecedorAction.do?method=gravar"  method="POST"  onsubmit="return validateFornecedorForm(this);">
   <div class='pageForm'>
   <html:hidden property="idFornecedor" />
      <div class='formTitle'>      
	        <logic:equal value="true"  name="to" property="update" >
	            

	       		<bean:message key="app.form.update"/>&nbsp;<bean:message key="fornecedor.entity"/>
	       </logic:equal>
	       <logic:notEqual value="true"  name="to"  property="update">
		       	<bean:message key="app.form.create"/>&nbsp;<bean:message key="fornecedor.entity"/>
	       </logic:notEqual>

      </div>       
        <div class='formField'>
            <label><bean:message key="fornecedor.nome"/></label>
            <html:text  property="nome" size="50" maxlength="255"  />
        </div>   
        <div class='formField'>
            <label><bean:message key="local.city"/></label>            
           	  <html:text   property="cidade" size="20" maxlength="255"  />	      
        </div>
       
       	${el:defineAllSearchResultsAsList('to.searcher', 'request', pageContext)}
        <div class='formField'>
            <label><bean:message key="local.state"/></label>            
           	<html:select  property="idUf" >
					<html:option value=""></html:option>						
					<logic:present name="ufList">
					<html:options   collection="ufList"  labelProperty="sigla"  property="idUf" />
					</logic:present>
			</html:select>    
        </div>  
        
         <div class='formField'>
            <label><bean:message key="fornecedor.telefone"/></label>
            <html:text  property="telefone" size="30" maxlength="20"  />
        </div> 
         <div class='formField'>
            <label><bean:message key="fornecedor.email"/></label>
            <html:text  property="email" size="50" maxlength="120"  />
        </div> 
         <div class='formField'>
            <label><bean:message key="fornecedor.observacao"/></label><br>
            <html:textarea   property="observacao"  rows="7" cols="60" onkeypress="javascript:limitLength(this,1000)" 
               onkeyup="javascript:limitLength(this,1000)" />              
        </div>      
        <hr size="1">
        <div class='formButton'>    
          <a onclick="FornecedorForm" class="linkButton">  <bean:message key="app.button.reset"/></a>
      		 &nbsp;
		     <a onclick="javascript:gravar();" class="linkButton">  <bean:message key="app.button.store"/></a>
          </div>
            
    </div>
    </html:form>
   
      
<script type="text/javascript">
 // <!--
  Mascara.adiciona(FornecedorForm.telefone,'<bean:message key="mask.inteiro.positivo"/>');
   
  var action= '<html:rewrite page="/fornecedorAction.do"/>';
  var nForm =  'FornecedorForm';

 function gravar(){	 
	 executeForm(nForm, action, 'gravar');
 }
 
  //-->
</script>
</body>
</html>